<?

/**
* local collection functions of tocmenu_Y1
*
* @author Adesanto Asman
* @version 1.0
* @license Free
* @copyright Copyright (c)2007, Adesanto Asman
* @package CLHandlers
* 
*/

/**
* @package CLHandlers
* 
*/
class CLHandlers{
  
  /**
  * insert into detail
  * 
  * @param  string  $Db
  * @param  string  $values
  * @param  string  $srcDb
  *
  */
  function insToDtl(&$Db,
                    &$values,
                    &$srcDb){
                      
    $query  = "INSERT INTO ".$srcDb."
               (USERID,
                COMPANY,
                LEVELMN,
                DESCRIPTION,
                STATUS,
                ENTRY_RIGHTS,
                EDIT_RIGHTS,
                DELETE_RIGHTS,
                VIEW_RIGHTS,
                FINALIZE_RIGHTS,
                APPROVED_RIGHTS,
                JOURNAL_RIGHTS,
                PROGRAMS,
                PICT)
               VALUES (".$values.") ";
               
    $Db->execQuery($query);
  }
  
  /**
  * insert into header
  * 
  * @param  string  $Db
  * @param  string  $values
  * @param  string  $srcDb
  *
  */
  function insToHdr(&$Db,
                    &$values,
                    &$srcDb){
                      
    $query  = "INSERT INTO ".$srcDb."
               (USERID,
                USERNAME,
                PASSWORD,
                COMPANY,
                POS,
                DEPARTMENT,
                STATUS)
               VALUES (".$values.") ";
               
    $Db->execQuery($query);
  }
  
  /**
  * Delete record
  * 
  * @param  string  $Db
  * @param  string  $userId
  * @param  string  $userComp
  * @param  string  $srcDb
  *
  */
  function dbEntDelete(&$Db,
        	             &$userId,
        	             &$userComp,
        	             &$srcDb){
        	              
    $query  = "DELETE FROM ".$srcDb."
               WHERE  USERID='".$userId."'
                      AND COMPANY='".$userComp."' ";
                      
    $Db->execQuery($query);
  }
}

?> 